import request from "../request";
// 用户登录
export const userLogin = (data) => {
    return request({
        url: "/auth/userLogin",
        method: "post",
        data: data,
        methodType: "jsonStr",
    });
};

// 获取下级部门
export const getAllChildList = () => {
    return request({
        url: "/system/department/userBoxCount",
        method: "get",
        methodType: "jsonStr",
    });
};

// 登出
export const userLogout = () => {
    return request({
        url: "/auth/logout",
        method: "post",
        methodType: "jsonStr",
    });
};


// 获取用户资料
export const getUserInfo = (params) => {
    return request({
        url: "/system/user/detail",
        method: "get",
        params: params,
        methodType: "jsonStr",
    });
};

// 用户资料修改
export const updateUserInfo = (data) => {
    return request({
        url: "/system/user/update",
        method: "post",
        data: data,
        methodType: "jsonStr",
    });
};

// 修改密码
export const updatePassword = (params) => {
    return request({
        url: '/system/user/updatePassword',
        method: 'post',
        params: params,
        methodType: "jsonStr",
    })
}

// 忘记密码 - 发送验证码
export const smsSendCaptcha = (params) => {
    return request({
        url: "/system/sms/sendCaptcha",
        method: "post",
        params: params,
        methodType: "jsonStr",
    });
};

// 忘记密码 - 校验验证码
export const smsCheckCaptcha = (params) => {
    return request({
        url: "/system/sms/checkCaptcha",
        method: "post",
        params: params,
        methodType: "jsonStr",
    });
};

// 忘记密码 - 重置密码
export const userResetPassword = (params) => {
    return request({
        url: "/system/user/resetPassword",
        method: "post",
        params: params,
        methodType: "jsonStr",
    });
};

//获得当前域名对应图标
export const getDomainInfo = (params) => {
    return request({
        url: "/system/company/domainInfo",
        method: "get",
        params: params,
        methodType: "jsonStr",
    });
};

// 获得上传的logo
export const getLogoList = (params) => {
    return request({
        url: "/system/config/getLogo",
        method: "get",
        params: params,
        methodType: "jsonStr",
    });
};

// 客服登录 - 公司列表
export const getCompanyList = (data) => {
    return request({
        url: "/system/company/list",
        method: "post",
        data: data,
        methodType: "jsonStr",
    });
};

// 部门列表
export const getDepartmentList = (data) => {
    return request({
        url: "/system/department/list",
        method: "post",
        data: data,
        methodType: "jsonStr",
    });
};

// 客服登录
export const oALogin = (data) => {
    return request({
        url: "/auth/oaLogin",
        method: "post",
        data: data,
        methodType: "jsonStr",
    });
};

// 根据token 获得用户信息
export const getLoginInfo = () => {
    return request({
        url: "/auth/loginInfo",
        method: "get",
        methodType: "jsonStr",
    });
};

// 三方登录
export const ticketLogin = (data) => {
    return request({
        url: "/auth/ticketLogin",
        method: "post",
        data,
        methodType: "jsonStr",
    });
};


// 获得是否需要弹出弹窗
export const getWifiPopup = () => {
    return request({
        url: "/system/config/getPopUp",
        method: "get",
        methodType: "jsonStr",
    });
};

// 弹窗中点击确认时，调用接口
export const updateWifiPopup = (data) => {
    return request({
        url: "/system/config/updatePop",
        method: "get",
        data: data,
        methodType: "jsonStr",
    });
};